import request from '@/utils/request'
const api_name = '/system/role'
export default {
    //根据id查询角色
    getRoleById(id){
        return request({
            //接口路径
            url: `${api_name}/info/${id}`,
            method: 'get',
        })
    },
    //列表
    getPageList(current, limit, name) {
        return request({
            //接口路径
            url: `${api_name}/list/${current}/${limit}?name=${name}`,
            method: 'get',
        })
    },
    //根据id进行删除
    removeById(id) {
        return request({
            //接口路径
            url: `${api_name}/remove/${id}`,
            method: 'delete',
        })
    },
    //保存角色
    saveRole(role) {
        return request({
            //接口路径
            url: `${api_name}/save`,
            method: 'post',
            data:role
        })
    },
    //修改角色
    updateRole(role){
        return request({
            //接口路径
            url: `${api_name}/update`,
            method: 'post',
            data:role
        })
    },
    //批量删除
    batchRemove(ids){
        return request({
            //接口路径
            url: `${api_name}/batchRemove`,
            method: 'delete',
            data:ids
        })
    },
    

} 